﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Activities;

namespace AppToolkit.WF.Services
{

    public sealed class ProgressActivity : CodeActivity
    {
        public InArgument<Int32> Current { get; set; }

        public InArgument<Int32> Maximum { get; set; }

        // If your activity returns a value, derive from CodeActivity<TResult>
        // and return the value from the Execute method.
        protected override void Execute(CodeActivityContext context)
        {
            // Obtain the runtime value of the Text input argument
            var current = context.GetValue(this.Current);
            var maximum = context.GetValue(this.Maximum);

            context.Track(new ProgressTrackingRecord("ProgressTrackingRecord") 
            {
                Current=current,
                Maximum=maximum,
            });
        }
    }
}
